﻿using System;
using System.Collections.Generic;
using System.Data;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class control_chitiettour_InfoTourLienQuan : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

        }
    }
    protected string GetInfoTourLienQuan()
    {
        string htmlCode = "";
        long idTour = Convert.ToInt64(Request.QueryString.Get("id"));
        DataTable tbl =
            DataAccess.ExeSQLToDataTable("select top(10) * from dev_news where diemden = '" + GetIdDiemDen(idTour) + "' @ checktour = 1 and status=1 order by idnews desc");
        if (tbl.Rows.Count > 0)
        {
            foreach (DataRow dr in tbl.Rows)
            {
                htmlCode += @"
            <li>
                <img src='style/css/img/icon_arrow2.gif' />
                <a href='chitiettourdulich.aspx?id=" + idTour + @"'>" +ITNLip.CatChuoi(dr["title"].ToString(),90 )+ @"</a>
            </li>";
            }
        }
        else
        {
            htmlCode = @"<a style='color:red;'><b>Dữ liệu đang cập nhật.</b></a>";
        }
        return htmlCode;
    }
    protected long GetIdDiemDen(long idTour)
    {
        
        DataTable tbl =
            DataAccess.ExeSQLToDataTable("select diemden from dev_news where idnews = '" + idTour + "'");
        return Convert.ToInt64(tbl.Rows[0]["diemden"]);
    }
}